package com.snpic.appaw.module.insure.dal.mysql.cxOrder;

import com.snpic.appaw.framework.common.pojo.PageResult;
import com.snpic.appaw.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.snpic.appaw.framework.mybatis.core.mapper.BaseMapperX;
import com.snpic.appaw.module.insure.dal.dataobject.cxOrder.CxOrderDO;
import org.apache.ibatis.annotations.Mapper;
import com.snpic.appaw.module.insure.controller.app.cxOrder.vo.*;

/**
 * 车险订单 Mapper
 *
 * @author jijun
 */
@Mapper
public interface CxOrderMapper extends BaseMapperX<CxOrderDO> {

    default PageResult<CxOrderDO> selectPage(AppCxOrderDOPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CxOrderDO>()
                .eqIfPresent(CxOrderDO::getProductCode, reqVO.getProductCode())
                .eqIfPresent(CxOrderDO::getSessionid, reqVO.getSessionid())
                .eqIfPresent(CxOrderDO::getCustomerId, reqVO.getCustomerId())
                .eqIfPresent(CxOrderDO::getOrderNo, reqVO.getOrderNo())
                .eqIfPresent(CxOrderDO::getProvinceCode, reqVO.getProvinceCode())
                .likeIfPresent(CxOrderDO::getProvinceName, reqVO.getProvinceName())
                .eqIfPresent(CxOrderDO::getCityCode, reqVO.getCityCode())
                .likeIfPresent(CxOrderDO::getCityName, reqVO.getCityName())
                .eqIfPresent(CxOrderDO::getNewcarFlag, reqVO.getNewcarFlag())
                .eqIfPresent(CxOrderDO::getPlateno, reqVO.getPlateno())
                .likeIfPresent(CxOrderDO::getOwnerName, reqVO.getOwnerName())
                .eqIfPresent(CxOrderDO::getOwnerMobile, reqVO.getOwnerMobile())
                .eqIfPresent(CxOrderDO::getOwnerIdno, reqVO.getOwnerIdno())
                .eqIfPresent(CxOrderDO::getOwnerEmail, reqVO.getOwnerEmail())
                .eqIfPresent(CxOrderDO::getOwnerAddress, reqVO.getOwnerAddress())
                .likeIfPresent(CxOrderDO::getSjrName, reqVO.getSjrName())
                .eqIfPresent(CxOrderDO::getSjrMobile, reqVO.getSjrMobile())
                .eqIfPresent(CxOrderDO::getSjrEmail, reqVO.getSjrEmail())
                .eqIfPresent(CxOrderDO::getSjrZipcode, reqVO.getSjrZipcode())
                .eqIfPresent(CxOrderDO::getAddressseeprovincecode, reqVO.getAddressseeprovincecode())
                .eqIfPresent(CxOrderDO::getAddressseeprovinces, reqVO.getAddressseeprovinces())
                .eqIfPresent(CxOrderDO::getAddressseecitycode, reqVO.getAddressseecitycode())
                .eqIfPresent(CxOrderDO::getAddressseecity, reqVO.getAddressseecity())
                .eqIfPresent(CxOrderDO::getAddressseetowncode, reqVO.getAddressseetowncode())
                .eqIfPresent(CxOrderDO::getAddressseetown, reqVO.getAddressseetown())
                .eqIfPresent(CxOrderDO::getPsAddress, reqVO.getPsAddress())
                .eqIfPresent(CxOrderDO::getPayments, reqVO.getPayments())
                .eqIfPresent(CxOrderDO::getOrderStatus, reqVO.getOrderStatus())
                .betweenIfPresent(CxOrderDO::getInsertTime, reqVO.getInsertTime())
                .eqIfPresent(CxOrderDO::getBusinessAppno, reqVO.getBusinessAppno())
                .eqIfPresent(CxOrderDO::getForceAppno, reqVO.getForceAppno())
                .eqIfPresent(CxOrderDO::getBusinessPolno, reqVO.getBusinessPolno())
                .eqIfPresent(CxOrderDO::getForcePolno, reqVO.getForcePolno())
                .eqIfPresent(CxOrderDO::getRefuseReason, reqVO.getRefuseReason())
                .eqIfPresent(CxOrderDO::getJqinsurancequerycode, reqVO.getJqinsurancequerycode())
                .eqIfPresent(CxOrderDO::getBuinsurancequerycode, reqVO.getBuinsurancequerycode())
                .eqIfPresent(CxOrderDO::getOrderChannel, reqVO.getOrderChannel())
                .eqIfPresent(CxOrderDO::getPayCheckcode, reqVO.getPayCheckcode())
                .eqIfPresent(CxOrderDO::getAppno, reqVO.getAppno())
                .eqIfPresent(CxOrderDO::getPolno, reqVO.getPolno())
                .eqIfPresent(CxOrderDO::getFlag, reqVO.getFlag())
                .eqIfPresent(CxOrderDO::getOpenId, reqVO.getOpenId())
                .betweenIfPresent(CxOrderDO::getInsureDate, reqVO.getInsureDate())
                .betweenIfPresent(CxOrderDO::getUnderwriteDate, reqVO.getUnderwriteDate())
                .eqIfPresent(CxOrderDO::getElrLevelCtp, reqVO.getElrLevelCtp())
                .eqIfPresent(CxOrderDO::getElrLevelCom, reqVO.getElrLevelCom())
                .eqIfPresent(CxOrderDO::getElrLevelAll, reqVO.getElrLevelAll())
                .eqIfPresent(CxOrderDO::getCheckno, reqVO.getCheckno())
                .eqIfPresent(CxOrderDO::getCheckcode, reqVO.getCheckcode())
                .eqIfPresent(CxOrderDO::getTradeno, reqVO.getTradeno())
                .betweenIfPresent(CxOrderDO::getCertiStartdate, reqVO.getCertiStartdate())
                .betweenIfPresent(CxOrderDO::getCertiEnddate, reqVO.getCertiEnddate())
                .betweenIfPresent(CxOrderDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(CxOrderDO::getRemark, reqVO.getRemark())
                .eqIfPresent(CxOrderDO::getPremium, reqVO.getPremium())
                .eqIfPresent(CxOrderDO::getRefereeCode, reqVO.getRefereeCode())
                .eqIfPresent(CxOrderDO::getOwnerProvinceCode, reqVO.getOwnerProvinceCode())
                .likeIfPresent(CxOrderDO::getOwnerProvinceName, reqVO.getOwnerProvinceName())
                .eqIfPresent(CxOrderDO::getOwnerCityCode, reqVO.getOwnerCityCode())
                .likeIfPresent(CxOrderDO::getOwnerCityName, reqVO.getOwnerCityName())
                .eqIfPresent(CxOrderDO::getOwnerAreaCode, reqVO.getOwnerAreaCode())
                .likeIfPresent(CxOrderDO::getOwnerAreaName, reqVO.getOwnerAreaName())
                .eqIfPresent(CxOrderDO::getRcldProductCode, reqVO.getRcldProductCode())
                .likeIfPresent(CxOrderDO::getRcldProductName, reqVO.getRcldProductName())
                .eqIfPresent(CxOrderDO::getProductAmount, reqVO.getProductAmount())
                .eqIfPresent(CxOrderDO::getRcldPolno, reqVO.getRcldPolno())
                .eqIfPresent(CxOrderDO::getRcldAppno, reqVO.getRcldAppno())
                .eqIfPresent(CxOrderDO::getHuishuoCode, reqVO.getHuishuoCode())
                .eqIfPresent(CxOrderDO::getRenewInsuranceFlag, reqVO.getRenewInsuranceFlag())
                .eqIfPresent(CxOrderDO::getCartype, reqVO.getCartype())
                .eqIfPresent(CxOrderDO::getO, reqVO.getO())
                .eqIfPresent(CxOrderDO::getHistoryStatus, reqVO.getHistoryStatus())
                .eqIfPresent(CxOrderDO::getOldId, reqVO.getOldId())
                .orderByDesc(CxOrderDO::getId));
    }

}